<template>
<div>
    <Card :bordered="false" dis-hover>
        <div class="container page-wrap w1250">
            <div class="page-title">
                <h2 class="data-record">当前共有<b>{{search.total}}</b>条资讯信息</h2>
            </div>
            <!-- 列表 -->
            <div class="news-list-wrap">
                <template v-for='item in newList'>
                    <a  @click='detailGo(item.GUID)'>
                        <dl class="news-list">
                            <dt class="news-list-img rela-img">
                                <img src="@/assets/images/news01.jpg" alt="">
                            </dt>
                            <dd class="news-list-text">
                                <h2>{{item.Title}}</h2>
                                <div class="news-list-info">
                                    <span class="iconfont icon-news-time">{{item.CREATE_TIME | getYMD}}</span>
                                    <span class="iconfont icon-news-pageviews">{{item.BrowseNum|| 0}}</span>
                                    <span class="iconfont icon-news-people" v-show="false"> <strong>{{item.chinesename}}</strong></span>
                                </div>
                                <p>{{item.Summary ||  '暂无内容' }}</p>
                            </dd>
                        </dl>
                    </a>
                </template>
		    </div>
		    <!-- 页码 -->
            <Page show-total  :page-size="search.PageSize" :current="search.PageIndex" :total="search.total"
            @on-change="changePage"></Page>
		  </div>
    </Card>
</div>
</template>

<script>
export default {
    data() {
        return {
            newList: [],
            search: {
                Title: "",
                BrowseNum: "",
                IsPublish: "Y",
                PageIndex: 1,
                PageSize: 10,
                total: 0,
                page: 1,
            },
        }
    },
    mounted() {},
    methods: {
        getData() {
            var self = this;

            this.axios.post('/api/news/search', this.search).then(function(res) {
                self.newList = res.datas;
                self.search.total = res.total;
                self.search.PageIndex = res.page;
            })
        },
        detailGo: function(GUID) {
            this.$router.push(`/front/newsDetail/${GUID}`);
        },
        changePage(pageNum) {
            this.search.PageIndex = pageNum;
            this.getData();
        },
    },
    created() {
        this.getData();
    },
    activated() {
        this.getData();
    }
}
</script>